<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-block">
          <?php
          if($message == 'filed'){
          ?>
          <div class="alert alert-error fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Filed!</strong> Fail to save data.
          </div>
          <?php
          }
          if($message == 'sukses'){
          ?>
          <div class="alert alert-success fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Success!</strong> Now you have new Master Gudang.
          </div>
          <?php
          }
          ?>
          <div class="widget-head">
            <h5><?=$title_table?></h5>
            <div class="widget-control pull-right">
              <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="<?=  site_url("asset/add-asset") ?>"><i class="icon-plus"></i> Add New</a></li>
              </ul>
            </div>
          </div>
          <div class="widget-content">
            <div class="widget-box">
              <table class="data-tbl-boxy table">
                <thead>
                  <tr>
                    <th>Date</th>
                    <th>Detail</th>
                    <th>Qty</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  if(is_array($data)){
                    $no = 1;
                    foreach ($data as $key => $value) {
                      if($value->id_asset_in_items){
                        $link_from = site_url("asset/add-asset/".$value->id_asset_in);
                        $string_from = $this->global_models->get_query("SELECT CONCAT(name, ' ', kode) AS name
                          FROM d_asset_in
                          WHERE id_asset_in = {$value->id_asset_in}");
                        $string_name = $string_from[0]->name;
                      }
                      else{
                        $string_from = $this->global_models->get_query("SELECT B.*
                          FROM d_asset_to_outlet AS A
                          LEFT JOIN m_outlet AS B ON A.id_outlet = B.id_outlet
                          WHERE A.id_asset_to_outlet = {$value->id_asset_to_outlet}");
                        $link_from = site_url("asset/add-management-outlet/{$string_from[0]->id_outlet}/".$value->id_asset_to_outlet);
                        $string_name = "Mr. Montir ".$string_from[0]->name;
                      }
                       print <<<EOD
                  <tr>
                    <td>{$value->tanggal}</td>
                    <td><a href='{$link_from}'>{$string_name}</a></td>
                    <td>{$value->qty}</td>
                  </tr>
EOD;
                          $no++;
                    }
                  }
                  ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>